from flask import Flask, render_template

app = Flask(__name__)

student = {
	'name': 'zhangsan',
	'age': 38,
	'gender': '女'
}

student_list = [
	{
		'name': 'zhangsan',
		'age': 38,
		'gender': '女'
	},
	{
		'name': 'lisi',
		'age': 69,
		'gender': '男'
	},
	{
		'name': 'wangwu',
		'age': 17,
		'gender': '女'
	}
]
student_dict = {
	'a': {
		'name': 'zhangsan',
		'age': 38,
		'gender': '女'
	},
	'b': {
		'name': 'lisi',
		'age': 69,
		'gender': '男'
	},
	'c': {
		'name': 'wangwu',
		'age': 17,
		'gender': '女'
	}
}


@app.route('/')
def test1():  # put application's code here
	# 为了方便在模板中使用，可以把字典打散
	return render_template('01.html', **student)


@app.route('/test2')
def test2():  # put application's code here
	return render_template('02.html', student_list = student_list)


@app.route('/test3')
def test3():
    return render_template('03.html', student_dict = student_dict)


if __name__ == '__main__':
	app.run(debug = True)
